void mkshort_del_handle(void *h);
void setshort_length(void *, int n);
void setshort_badchars(void *, const char *);
+void setshort_goodchars(void *, const char *);
void setshort_mustupper(void *, int n);
void setshort_mustuniq(void *, int n);
void setshort_whitespace_ok(void *, int n);
if (snwhiteopt)
setshort_whitespace_ok(mkshort_handle, atoi(snwhiteopt));
+ /* Technically, even this is a little loose as spaces arent allowed */
+ setshort_goodchars(mkshort_handle, "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789");
setshort_mustupper(mkshort_handle, 1);
}
* but rather a garmin "fixed length" buffer that's padded
* to the end with spaces. So this is NOT (strlen+1).
*/
+fprintf(stderr, "%s\n", ident);
memcpy(way[i]->ident, ident, strlen(ident));
if (global_opts.synthesize_shortnames) {
xfree(ident);
int whitespaceok;
unsigned int target_len;
char *badchars;
+ char *goodchars;
int must_uniq;
queue namelist[PRIME];
int depth[PRIME];
hdl->badchars = xstrdup(s);
}
}
+void
+setshort_goodchars(void *h, const char *s)
+{
+ mkshort_handle *hdl = h;
+
+ hdl->goodchars = xstrdup(s);
+}
void
setshort_mustupper(void *h, int i)
for (i=0;i<l;i++) {
if (strchr(hdl->badchars, tstring[i]) || !isascii(tstring[i]))
continue;
+ if (hdl->goodchars && (!strchr(hdl->goodchars, tstring[i])))
+ continue;
*cp++ = tstring[i];
}
*cp = 0;